package com.yyplatform.admin.infra.utils;

import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;

/**
 * Created on 2024-11-18
 */
public class Md5Utils {

    public static String getMd5(String str) {
        if (StringUtils.isEmpty(str)) {
            throw new RuntimeException("str is empty");
        }
        return DigestUtils.md5DigestAsHex(str.getBytes());
    }

}
